package no.ntnu.fp.model.events;

import no.ntnu.fp.model.LoggedInModel.LoginError;


@SuppressWarnings("serial")
public class LoggedInChangedEvent extends ModelEvent {

	private final boolean previousState, newState;
	private final LoginError error;
	
	public LoggedInChangedEvent(Object source, boolean previousState, 
			boolean newState, LoginError error) {
		super(source);
		this.previousState = previousState;
		this.newState = newState;
		this.error = error;
	}

	public boolean wasLoggedIn() {
		return previousState;
	}

	public boolean isLoggedIn() {
		return newState;
	}

	public LoginError getError() {
		return error;
	}
}
